package com;



import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import dao.DBManipulation;

/**
 * Servlet implementation class RegisterServlet
 */
@WebServlet("/RegisterServlet")
public class RegisterServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public RegisterServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	
	RegisterBean rbean= new RegisterBean();
	RegisterBean2 rb=new RegisterBean2();
	
	rbean.setPan(request.getParameter("pan"));
	rbean.setDateofBirth(request.getParameter("dob"));
	rbean.setPassword(request.getParameter("cpass"));
	rbean.setEmail(request.getParameter("email"));
	rbean.setPhoneno(Long.parseLong(request.getParameter("phone")));
	rb.setPan(request.getParameter("pan"));
	DBManipulation dbc= new DBManipulation();
	dbc.insertRegisterInfo(rbean);
	
	RequestDispatcher rd=request.getRequestDispatcher("Register2.jsp");
	rd.forward(request, response);
	}
	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	

	}

}
